home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Tools - Objects / MacApp / MacApp 2.0 CD Release / MacApp 2.0 (Many Libraries) / Interfaces / CIncludes / UTEView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-27  |  25.2 KB  |  614 lines  |  [TEXT/MPS ]

  1. /*[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]*/
  2. /* UTEView.p */
  3. /* Copyright © 1986-1990 Apple Computer, Inc.  All rights reserved. */
  4. #ifndef  __TEView__
  5. #define __TEView__  0
  6. #endif
  7. #if  ! __TEView__
  8. #define __TEView__  1
  9.  
  10.         /* • Auto-Include the requirements for this unit's interface. */
  11. #ifndef  __UMacApp__
  12. #include "UMacApp.h"
  13. #endif
  14.  
  15. const short kUnlimited            = SHRT_MAX;                /* The maximum number of characters in the
  16.                                                          fText of a TTEView object */
  17.  
  18. const short kWithStyle            = true;                    /* Parameters to TTEView.ITEView */
  19. const short kWithoutStyle        = false;
  20. const short kSaveCurrentChars    = true;                    /* Parameter to ITECommand */
  21.  
  22. const short Chr00                ='\000';                /* Needed for ControlCharSet */
  23. const short Chr1F                ='\037';
  24.  
  25. const short kMinAhead            = 96;                    /* Default value for fMinAhead */
  26.  
  27.  
  28. typedef unsigned long ControlCharSet;
  29.  
  30. struct TEViewTemplate {
  31.     unsigned itsStyleType : 1;
  32.     unsigned itsAutoWrap : 1;
  33.     unsigned itsAcceptsChanges : 1;
  34.     unsigned itsFreesText : 1;
  35.     unsigned filler1 : 12;
  36.     short itsKeyCmdNumber;
  37.     short itsMaxChars;
  38.     Rect itsInset;
  39.     short itsJustification;
  40.     Style itsTextFace;
  41.     short itsTextSize;
  42.     RGBColor itsTextColor;
  43.     Str255 itsFontName;                                    /* Actually a variable length P-String */
  44. };
  45. typedef TEViewTemplate *TEViewTemplatePtr;
  46.  
  47. class TTEView : public TView {
  48.   public:                /* TTEView is a view subclass representing a
  49.                                                          TextEdit record. TextEdit is the simple
  50.                                                          text-editing facility built into the
  51.                                                          Macintosh ROM. The purpose of a TEView is
  52.                                                          to make TextEdit function properly in a
  53.                                                          MacApp environment, for things like
  54.                                                          scrolling, printing, page breaks, and
  55.                                                          command handling */
  56.  
  57.     TEHandle fHTE;                                        /* Handle to the actual TextEdit object */
  58.  
  59.     Handle fText;                                        /* The text in the TEHandle */
  60.     Handle fSavedTEHandle;                                /* Saved handle from TENew */
  61.  
  62.     Rect fInset;
  63.        /* Amount to inset text from edges of view */
  64.  
  65.     CmdNumber fKeyCmdNumber;                            /* Will be used as the string number for
  66.                                                          "Undo Typing" */
  67.  
  68.     short fMaxChars;                                    /* Maximum number of chars to accept into
  69.                                                          fText. Default is MAXINT; stuff to
  70.                                                          different value if you want to limit max
  71.                                                          chars to fewer than MAXINT */
  72.  
  73.     long fLastHeight;                                    /* Last checked height of record. If the
  74.                                                          record is stylish, this represents the
  75.                                                          height in pixels. For old-style records,
  76.  
  77.                                                          equals number of lines. */
  78.  
  79.     long fLastWidth;
  80.        /* Last checked width of record. Not currently
  81.                                                         used If the TE is styled, this r
  82.    epresents the
  83.                                                         width in pixels. */
  84.  
  85.     struct TTETypingCommand *fTypingCommand;            /* The current TE Typing command relating to
  86.                                                          me, if any */
  87.  
  88.     TextStyle fTextStyle;                                /* Current style of text */
  89.  
  90.     short fJustification;                                /* Current justification of text record */
  91.  
  92.     Boolean fAcceptsChanges;                            /* Set to FALSE to have text which will not
  93.                                                          accept any change, such as text on the
  94.                                                          Clipboard, or perhaps received mail */
  95.     Boolean fStyleType;                                    /* Set to kWithStyle if record is styled */
  96.     Boolean fAutoWrap;                                    /* Set to FALSE for line wrapping at CR's
  97.                                                          only */
  98.     Boolean fFreeText;                                    /* Determines if fText should be freed on
  99.                                                          Free. */
  100.     Boolean fSpecsChanged;                                /* Something recently happened which could
  101.                                                          effect font/style/size/color menu item
  102.                                                          updating. Should be reset to FALSE when
  103.                                                          application has taken the appropriate
  104.                                                          action. */
  105.     short fLastPageBreak;                                /* Caches last page break computed. */
  106.     short fLastLine;
  107.        /* Last line of text of the last page break */
  108.     ControlCharSet fControlChars;                        /* Control chars accepted in text */
  109.     short fMinAhead;
  110.        /* Minimum amount by which to autoscroll ahead
  111.                                                         when scrolling selection into vi
  112.    ew.  (When typing
  113.                                                         etc. */
  114.  
  115.                                 /* Initialize and Free */
  116.  
  117.     virtual pascal void ITEView(TDocument *itsDocument, TView *itsSuperView, VPoint *itsLocation, 
  118.        VPoint *itsSize, SizeDeterminer itsHDeterminer, SizeDeterminer itsVDeterminer, Rect *itsInset
  119.        , TextStyle *itsTextStyle, short itsJustification, Boolean itsStyleType, Boolean itsAutoWrap);
  120.                 /* For Initialization of procedurally created TEView. */
  121.  
  122.     virtual pascal void IRes(TDocument *itsDocument, TView *itsSuperView, Ptr *itsParams);
  123.                 /* Initialize a TTEView via a 'view' resource. */
  124.  
  125.     virtual pascal void WRes(ViewRsrcHandle theResource, Ptr *itsParams);
  126.                 /* Write the object out to a view resource. */
  127.  
  128.     virtual pascal void WriteRes(ViewRsrcHandle theResource, Ptr *itsParams);
  129.                 /* Set up the type and signature of this object and call WRes. */
  130.  
  131.     virtual pascal void Free(void);
  132.                 /* Frees the TERecord and optionally fText, then frees SELF */
  133.  
  134.     virtual pascal void MakeTERecord(void);
  135.                 /* Called with grafport properly set, to create the actual TE Record */
  136.  
  137.                 /* Commands and Menus */
  138.  
  139.     virtual pascal TCommand *DoKeyCommand(short ch, short aKeyCode, EventInfo *info);
  140.                 /* Handles keystrokes */
  141.  
  142.     virtual pascal struct TTECommand *DoMakeEditCommand(CmdNumber aCmdNumber);
  143.                 /* Make a command for handling edit menu stuff */
  144.  
  145.     virtual pascal struct TTEStyleCommand *DoMakeStyleCommand(TextStyle *aStyle, CmdNumber 
  146.        itsCmdNumber, short itsMode);
  147.                 /* Make a style change command */
  148.  
  149.     virtual pascal struct TTETypingCommand *DoMakeTypingCommand(short ch);
  150.                 /* Make a typing command for handling keystrokes */
  151.  
  152.     virtual pascal TCommand *DoMenuCommand(CmdNumber aCmdNumber);
  153.                 /* Handles menu commands */
  154.  
  155.     virtual pascal TCommand *DoMouseCommand(Point *theMouse, EventInfo *info, Point *hysteresis);
  156.                 /* Handles mousepresses */
  157.  
  158.     virtual pascal void DoneTyping(void);
  159.                 /* No further typing can occur for the current typing command */
  160.  
  161.     virtual pascal void DoSetupMenus(void);
  162.                 /* Sets up menus */
  163.  
  164.     virtual pascal void InstallSelection(Boolean wasActive, Boolean beActive);
  165.                 /* Called at activate/deactivate time to get insertion-point-blinking right (or to
  166.                 highlight the selection) */
  167.  
  168.     virtual pascal void ViewEnable(Boolean state, Boolean redraw);
  169.                 /* Resets the view's idle */
  170.  
  171.                 /* Screen Display */
  172.  
  173.     virtual pascal Boolean DoIdle(IdlePhase phase);
  174.                 /* Blinks the insertion point */
  175.  
  176.     virtual pascal Boolean DoSetCursor(Point localPoint, RgnHandle cursorRgn);
  177.                 /* Sets the cursor to the I-beam */
  178.  
  179.     virtual pascal void Draw(Rect *area);
  180.                 /* Draw the text in a frame or on the printed page */
  181.  
  182.     virtual pascal void ShowReverted(void);
  183.                 /* Make sure line starts are correct before redisplay */
  184.  
  185.                 /* Size Changes */
  186.  
  187.     virtual pascal void BeInPort(GrafPtr itsPort);
  188.                 /* Now that a grafport is established for the view, tells TextEdit about it */
  189.  
  190.     virtual pascal void BeInScroller(TScroller *itsScroller);
  191.                 /* Gives us a chance to set the scroll parameters */
  192.  
  193.     virtual pascal void CalcMinSize(VPoint *minSize);
  194.                 /* Compute the minimum size of the view */
  195.  
  196.     virtual pascal long CalcRealHeight(void);
  197.                 /* Calculate true height of record, including last character if it is a carriage
  198.                 return */
  199.  
  200.     virtual pascal long CalcRealWidth(void);
  201.  
  202.     /* Calculate true width of record.  Only supported for NON-styled TE Records right now */
  203.  
  204.     virtual pascal void ComputeSize(VPoint *newSize);
  205.                 /* Compute the actual size of the view */
  206.  
  207.     virtual pascal void Resize(VCoordinate width, VCoordinate height, Boolean invalidate);
  208.                 /* Installs the new size for both the View and TextEdit */
  209.  
  210.     virtual pascal void SynchView(Boolean redraw);
  211.                 /* Keeps view metrics in synch after TextEdit operation. If redraw is true then
  212.                 ScrollSelectionIntoView is called to make sure the selection is visible.*/
  213.  
  214.                 /* Clipboard */
  215.  
  216.  
  217.        /* NOTE -- These methods apply only to a TEView installed as the view in the Clipboard
  218.                 */
  219.  
  220.     virtual pascal Boolean ContainsClipType(ResType aType);
  221.                 /* Determines whether the indicated clipboard type can be produced by the view */
  222.  
  223.     virtual pascal long GivePasteData(Handle aDataHandle, ResType dataType);
  224.                 /* Supplies data to be PASTED by some requesting PASTE command */
  225.  
  226.     virtual pascal void WriteToDeskScrap(void);
  227.                 /* Produces TEXT data for the Desk Scrap when called upon to do so */
  228.  
  229.                 /* Miscellaneous */
  230.  
  231.     virtual pascal void AutoScrolling(Boolean doScrolling);
  232.                 /* Set TERecord auto scrolling to given value via TEAutoScroll */
  233.  
  234.     virtual pascal Boolean ClikLoop(void);
  235.                 /* Forwarded to from the global routine: ClickLoopForTTEView which was set as the
  236.                 TE's ClikLoop.  Typically handles autoscrolling for the view. */
  237.  
  238.     virtual pascal void CalcSelLoc(Rect *selectionRect);
  239.                 /* Calculates the location of the current Selection */
  240.  
  241.     virtual pascal void ChangeWrap(Boolean newAutoWrap, Boolean redraw);
  242.                 /* Changes auto-wrapping behavior, redrawing if requested */
  243.  
  244.     virtual pascal Boolean ContinuousStyle(short firstChar, short lastChar, short *mode, TextStyle *aStyle);
  245.                 /* Returns TRUE if the style of the characters within the given range is wholly
  246.                 continuous. The style attributes to check are specified by mode, which has the same
  247.                 meaning as in the TextEdit call TESetStyle. Attributes which are continuous are
  248.                 returned in aStyle, with the appropriate bits set in mode. Font style attribute
  249.                 bits are individually checked across the selection range, and returned set to 1 if
  250.                 that attribute is continuous. */
  251.  
  252.     virtual pascal void ExtractStyles(TEStyleHandle *theStyles, STHandle *theElements);
  253.                 /* Extract handles to style information for a TextEdit record, presumably for the
  254.                 purpose of storing the data to disk. Note that line heights can be recalculated,
  255.  
  256.                 and as such don't need to be stored. */
  257.  
  258.     virtual pascal Handle ExtractText(void);
  259.                 /* For sake of completeness. Extract handle to text, presumably for the purpose of
  260.                 storing the text externally (perhaps to disk). */
  261.  
  262.     virtual pascal void RecalcText(void);
  263.                 /* Tells TextEdit to recompute linestarts */
  264.  
  265.     virtual pascal void ScrollSelectionIntoView(void);
  266.  
  267.        /* Scrolls the selection into view -- called after Commands are done or undone If auto
  268.                 scrolling is on, calls TESelView to do the right thing */
  269.  
  270.     virtual pascal void SetJustification(short newJust, Boolean redraw);
  271.                 /* Sets the TERecord to the given justification. If redraw is true then the view is
  272.                 redrawn by calling ForceRedraw. Otherwise it is assumed the called will get the
  273.                 view redrawn. */
  274.  
  275.     virtual pascal void SetOneStyle(short theStart, short theEnd, short theMode, TextStyle *theStyle
  276.        , Boolean redraw);
  277.                 /* Sets a text style continuously over a range. In unstylish TERecords, the style is
  278.                 set across the entire record. If redraw is true then the text is redrawn. */
  279.  
  280.     virtual pascal void SetText(StringPtr theText);
  281.                 /* Convenience routine, to save from having to create a handle just to pass to
  282.                 StuffText. Note that if fSavedTEHandle already holds a saved handle, it will be
  283.                 disposed before StuffText is called. */
  284.  
  285.     virtual pascal Boolean SpaceForStyles(long rangeStart, long rangeEnd);
  286.                 /* Returns TRUE if there is enough memory to hold the styles over the given range in
  287.                 the TERecord */
  288.  
  289.     virtual pascal void StuffStyles(TEStyleHandle theStyles, STHandle theElements);
  290.  
  291.        /* Installs style information, presumably fetched from disk, into the TextEdit record.
  292.                 */                                        /* Installs text into the TextEdit
  293.                                                          record.Note that this destroys any
  294.                                                          existing style information -- StuffStyles
  295.                                                          should be called if styles are to be
  296.                                                          attached to this text information. */
  297.  
  298.     virtual pascal void StuffText(Handle theText);
  299.  
  300.         /* Installs text into the TextEdit record. Note that this destroys any existing style
  301.                 information -- StuffStyles should be called if styles are to be attached to this
  302.                 text information */
  303.  
  304.     virtual pascal void StuffTERects(Rect *newTERect);
  305.                 /* installs "newTERect" as the dest & view rect of the TextEdit record */
  306.  
  307.                 /* Printing */
  308.  
  309.     virtual pascal VCoordinate DoBreakFollowing(VHSelect vhs, VCoordinate prevBreak, Boolean *
  310.        automatic);
  311.                 /* Computes the next page-break following 'prevBreak' in direction given by 'vhs' */
  312.  
  313.     virtual pascal void DoCalcViewPerPage(VPoint *viewPerPage);
  314.                 /* Computes how much of the view is to be allocated to each printed page */
  315.  
  316.     virtual pascal void DoSetPageOffset(VPoint *coord);
  317.                 /* At printing time, determine the location of the 'interior' (body)
  318.                 of the page */
  319.  
  320.     virtual pascal void GetPrintExtent(VRect *printExtent);
  321.                 /* Print extent is the view's extent minus the insets. */
  322.  
  323.                 /* Debugging */
  324.  
  325.     virtual pascal void IdentifySoftware(void);
  326.                 /* Tells compile date of this unit */
  327.  
  328.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  329.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  330.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  331.                 fields. */
  332.  
  333. };
  334.  
  335. class TTECommand : public TCommand {
  336.   public:            /* A command that adds characters to, or
  337.                                                          delete characters from, a TEView */
  338.  
  339.     TTEView *fTEView;                                    /* The TEView operated on */
  340.  
  341.     TEHandle fHTE;                                        /* same as fTEView's fHTE; duplicated for
  342.                                                          code efficiency */
  343.  
  344.     short fOldStart;
  345.        /* The beginning position of the selection at
  346.                                                          the moment just before the command was
  347.                                                          done. */
  348.     short fOldEnd;                                        /* The end position of the selection at the
  349.                                                          moment just before the command was done. */
  350.     Handle fOldText;                                    /* If fOldStart = fOldEnd, i.e., if old
  351.                                                          selection had been an insertion point,
  352.  
  353.                                                          this will be NIL. Otherwise, provides a
  354.                                                          temporary home for the characters
  355.                                                          comprising the old selection */
  356.     StScrpHandle fOldStyles;
  357.  
  358.     short fNewStart;                                    /* The beginning location in the Text of the
  359.                                                          new text that is added by the command, if
  360.                                                          any. */
  361.     short fNewEnd;
  362.        /* The ending location in the Text of the new
  363.                                                          text that is added by the command, if any.
  364.                                                          */
  365.     Handle fNewText;                                    /* A Handle to the characters added by the
  366.                                                          command */
  367.     StScrpHandle fNewStyles;
  368.  
  369.     Handle fPadding;                                    /* Handle to fill size between new and old.
  370.                                                          This insures that we can always undo and
  371.                                                          redo. */
  372.     short fTextPad;
  373.        /* Size difference between New and Old text */
  374.     long fStylePad;
  375.        /* Size difference between New and Old styles
  376.                                                          */
  377.  
  378.                                 /* Initialize and Free */
  379.  
  380.     virtual pascal void ITECommand(TTEView *itsTEView, CmdNumber itsCmdNumber, Boolean itsSaveText);
  381.                 /* Initialize the command; if unsuccessful, exit is via Failure mechanism. */
  382.  
  383.     virtual pascal void Free(void);
  384.  
  385.         /* Free the text handles holding information needed for Undo/Redo, then Frees SELF */
  386.  
  387.                 /* Command execution phase overrides */
  388.  
  389.     virtual pascal void DoIt(void);
  390.                 /* Focuses, then calls DoMainFunction */
  391.  
  392.     virtual pascal void RedoIt(void);
  393.                 /* Focuses, calls RestoreSelection to get selection right, then calls DoMainFunction
  394.                 to reinstate the changes done in DoIt which were undone by a preceding UndoIt */
  395.  
  396.     virtual pascal void UndoIt(void);
  397.  
  398.         /* Focuses, then dispatches to RemoveAdditions, ReviveDeletions, and RestoreSelection
  399.                 to accomplish the Undo */
  400.  
  401.  
  402.        /* Command execution - Restoration of Selection -- called in both UNDO and REDO phases
  403.                 */
  404.  
  405.     virtual pascal void RestoreSelection(void);
  406.                 /* Set the Selection to be what it was just before the DO phase of the command was
  407.                 performed */
  408.  
  409.                 /* Command execution - steps in DO and REDO phases */
  410.  
  411.     virtual pascal void BanishOldText(void);
  412.                 /* Remove text that was selected at the outset of the Do phase */
  413.  
  414.     virtual pascal void InstallNewText(void);
  415.                 /* Install the new text */
  416.  
  417.     virtual pascal void DoMainFunction(void);
  418.                 /* Forwards to the relevant methods for Do and Redo phases */
  419.  
  420.                 /* Command execution - steps in UNDO phase */
  421.  
  422.     virtual pascal void RemoveAdditions(void);
  423.                 /* Remove any characters which were added by the DO phase of the command */
  424.  
  425.     virtual pascal void ReviveDeletions(void);
  426.                 /* Bring back the characters which were removed during the DO phase */
  427.  
  428.                 /* Debugging */
  429.  
  430.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  431.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  432.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  433.                 fields. */
  434.  
  435. };
  436.  
  437. class TTECutCopyCommand : public TTECommand {
  438.   public: /* Command for handling Cut & Copy for the
  439.                                                          TEView. */
  440.     Boolean fClipCreated;                                /* Clipboard view created OK */
  441.  
  442.                                 /* Creation and Destruction */
  443.  
  444.     virtual pascal void ITECutCopyCommand(TTEView *itsTEView, CmdNumber itsCmdNumber);
  445.                 /* Initializes the command */
  446.  
  447.     virtual pascal void Free(void);
  448.                 /* Free the command */
  449.  
  450.                 /* Command execution */
  451.  
  452.     virtual pascal void DoIt(void);
  453.                 /* Launches a TEView for installation in the Clipboard, then calls DoMainFunction */
  454.  
  455.     virtual pascal void ReviveDeletions(void);
  456.                 /* Bring back the characters which were removed during the DO phase; called during
  457.                 UNDO phase */
  458.  
  459.                 /* Debugging */
  460.  
  461.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  462.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  463.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  464.                 fields. */
  465.  
  466. };
  467.  
  468. class TTEPasteCommand : public TTECommand {
  469.   public:    /* Command that handles Pasting for the
  470.                                                          TEView. */
  471.  
  472.             /* Initialization */
  473.     virtual pascal void ITEPasteCommand(TTEView *itsTEView);
  474.                 /* Initialize the command; if unsuccessful, signalled by Failure mechanism */
  475.  
  476.                 /* Debugging */
  477.  
  478.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  479.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  480.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  481.                 fields. */
  482.  
  483. };
  484.  
  485. class TTEStyleCommand : public TTECommand {
  486.   public:    /* Command for applying a new style to the
  487.                                                          TEView. */
  488.  
  489.             /* These two fields are only used in non-styled TextEdit records */
  490.     short fMode;                                        /* Mode for style change */
  491.     TextStyle fOldTextStyle;                            /* The original text style */
  492.     TextStyle fNewTextStyle;                            /* What we're replacing it with */
  493.  
  494.                                 /* Initialization */
  495.  
  496.     virtual pascal void ITEStyleCommand(TTEView *itsTEView, TextStyle *itsNewStyle, CmdNumber 
  497.        itsCmdNumber, short itsMode);
  498.                 /* Initialize the command; if unsuccessful, signalled by Failure mechanism */
  499.  
  500.                 /* Command execution */
  501.  
  502.     virtual pascal void InstallOneStyle(TextStyle *newStyl);
  503.                 /* Installs one style over entire record - for use with old TextEdit */
  504.  
  505.     virtual pascal void InstallManyStyles(StScrpHandle newStyls);
  506.                 /* Installs styles over selection range - for use with styled TextEdit */
  507.  
  508.     virtual pascal void DoIt(void);
  509.                 /* Applies style to selection range */
  510.  
  511.     virtual pascal void UndoIt(void);
  512.                 /* Undoes the action performed by DoIt. */
  513.  
  514.     virtual pascal void RedoIt(void);
  515.                 /* Calls DoIt. */
  516.  
  517.                 /* Debugging */
  518.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  519.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  520.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  521.                 fields. */
  522.  
  523. };
  524.  
  525. class TTETypingCommand : public TTECommand {
  526.   public:    /* The command that handles typing in a
  527.                                                          TEView. */
  528.     Boolean fCompleted;                                    /* Indicates whether further keystrokes will
  529.                                                          be extensions to this command (FALSE) or
  530.                                                          whether the command has already been
  531.                                                          completed (TRUE) */
  532.     short fFirstChar;                                    /* First character typed */
  533.  
  534.                                 /* Creation and destruction */
  535.  
  536.     virtual pascal void ITETypingCommand(TTEView *itsTEView, short itsFirstChar);
  537.                 /* Initialize the command; if not successful, exit is via Failure mechanism */
  538.  
  539.     virtual pascal void Free(void);
  540.                 /* Deallocate the command and dependent structures */
  541.  
  542.                 /* Command processing */
  543.  
  544.     virtual pascal void DoNormalChar(short aChar);
  545.                 /* Handle any typed character except a backspace */
  546.  
  547.     virtual pascal void BkSpcLeft(Handle theText, short curStart);
  548.                 /* Handle backspace to the left of the original selection */
  549.  
  550.     virtual pascal void BkSpcRight(Handle theText, short curStart);
  551.                 /* Handle backspace to the right of the original selection */
  552.  
  553.     virtual pascal void FwdDelete(Handle theText, short curStart, short curEnd);
  554.                 /*  Handle forward delete */
  555.  
  556.     virtual pascal void AddCharacter(short aChar);
  557.                 /* Add another character to an already-launched TETypingCommand */
  558.  
  559.     virtual pascal void DoIt(void);
  560.                 /* First processing for command; adds first character */
  561.  
  562.     virtual pascal void RedoIt(void);
  563.                 /* Handles undoing forward backspace*/
  564.  
  565.     virtual pascal void UndoIt(void);
  566.                 /* Process undo typing */
  567.  
  568.     virtual pascal void CompleteTyping(void);
  569.                 /* Mark as no more typing allowed and fix up style scrap, if any */
  570.  
  571.                 /* Debugging */
  572.  
  573.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  574.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  575.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  576.                 fields. */
  577.  
  578. };
  579.  
  580. /*--------------------------------------------------------------------------------------
  581.    ------------*/
  582.  
  583. extern pascal Ptr gDefClikLoopProc;                        /* Standard TextEdit click loop routine */
  584.  
  585.         /* The following are considered private, but appear in the interface in case you need to
  586.         override a method that uses one of these. */
  587.  
  588. extern pascal TTEView *pCurrTEView;
  589.    /* For the benefit of ClikLoopForTTEView only */
  590. #if  qDebug
  591. extern pascal Boolean pTEIntenseDebugging;
  592. #endif
  593.  
  594. /*--------------------------------------------------------------------------------------
  595.    ------------*/
  596.  
  597. extern pascal void InitUTEView(void);
  598.         /* Initialize TEView unit. */
  599.  
  600. extern pascal void SetSelect(short theStart, short theEnd, TEHandle hTE);
  601.         /* For those times when we don't want the selection range hilited when changed */
  602.  
  603. extern pascal Boolean ClickLoopForTTEView(void);
  604.         /* Called from TextEdit when the mouse is down forwards to TTEView.ClikLoop so that
  605.         autoscrolling may be done. */
  606.  
  607. extern pascal void DumpTERecord(TEHandle aTEH);
  608.         /* writes salient information about the TERecord out to the Debug window */
  609.  
  610. extern pascal void DumpTTECommand(TTECommand *theTTECommand);
  611.         /* writes TTECommand info out to Debug window */
  612. #endif
  613.  
  614.